function phone(number){
	// #ifdef APP-PLUS
	
			plus.android.requestPermissions(
				["android.permission.CALL_PHONE"], 
				function(resultObj) {
					var result = 0;
					for (var i = 0; i < resultObj.granted.length; i++) {
						var grantedPermission = resultObj.granted[i];
						console.log('已获取的权限：' + grantedPermission);
						result = 1
					}
					for (var i = 0; i < resultObj.deniedPresent.length; i++) {
						var deniedPresentPermission = resultObj.deniedPresent[i];
						console.log('拒绝本次申请的权限：' + deniedPresentPermission);
						result = 0
					}
					for (var i = 0; i < resultObj.deniedAlways.length; i++) {
						var deniedAlwaysPermission = resultObj.deniedAlways[i];
						console.log('永久拒绝申请的权限：' + deniedAlwaysPermission);
						result = -1
					}
					console.log(result);
					if(result == 1){
						console.log(number)
						uni.makePhoneCall({
							 phoneNumber: number,//电话号码
							success(ress) {
								console.log("拨打电话成功",ress)
							},
							fail(err) {
								console.log("拨打电话失败",'err')
							}
						});
					}else{
						uni.showToast({
							title:"请开启拨号权限",
							icon:"error",
						})
					}
				},
				function(error) {
					console.log('申请权限错误：' + error.code + " = " + error.message);
				}
			);
				// #endif
}

import {compress} from "./compress-image.js"
import {SER_URL} from '@/common/js/warehouse.js'


export const uploadUrl = 'http://192.168.2.110:13600/mi-service-tobacco/file/upload'

// 上传文件
function uploadFilePromise(file) {
	return new Promise(async (resolve, reject) => {
		let compress_res = await compress(file.url, file.name)
		let a = uni.uploadFile({
			url: uploadUrl, // 服务器url
			filePath: file.url, // 文件路劲
			file: compress_res.file, // 文件对象
			name: 'file', // 与文件对象对应得字段名
			success: (res) => {
				resolve(res.data)
			},
			fail: (err) => {
				reject(err)
			}
		})
	})
}

//导出
module.exports = {
	phone
}